package org.xdq.demo.components;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

@Component //说明受spring容器管理的对象
public class Computer {

    @Autowired //自动装配，默认按类型匹配
    @Qualifier("pr")
    private Usb usb;

    public void run(){
        System.out.println("......");
        usb.work();
        System.out.println("....OK!");
    }

}
